package com.gsm.controller;

import com.gsm.entity.Result;
import com.gsm.service.WebSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("web-subject")
public class WebSubjectController {
    @Autowired
    private WebSubjectService webSubjectService;

    /**
     * 根据 id 查询详细信息
     */
    @GetMapping("subject/{subjectId}")
    public Result selectSubjectInfoById(@PathVariable("subjectId")Long subjectId) {
        Result result = webSubjectService.selectSubjectInfoById(subjectId);
        return result;
    }

    /**
     * 查询 List
     */
    @GetMapping("subjectList")
    public Result selectSubjectList() {
        Result result = webSubjectService.selectSubjectList();
        return result;
    }

    /**
     * 查询首页零基础入门 List
     */
    @GetMapping("subjectZero")
    public Result selectSubjectZero() {
        Result result = webSubjectService.selectSubjectZero();
        return result;
    }

}
